//
//  FZSchoolAreaClassListModel.m
//  KidDubbing
//
//  Created by CyonLeuMBP on 2017/1/6.
//  Copyright © 2017年 Feizhu Tech. All rights reserved.
//

#import "SRSchoolClassListModel.h"

@implementation SRSchoolClassListModel


+ (NSDictionary *)JSONKeyPathsByPropertyKey
{
    return @{
             @"identifiter":@"group_id",
             @"teacherID":@"uid",
             @"teacherAvatar":@"teacher_avatar",
             @"name":@"class_name",
             @"shareURL":@"share_url",
             @"inviteCode":@"code",
             @"schoolName":@"school_name",
             @"grade":@"grade",
             @"createTime":@"create_time",
             @"limitNum":@"limit_num",
             @"currentNum":@"cur_num",
             
             @"avatar":@"image",
             @"info":@"info",
             
             @"nickname":@"nick_name",
             @"userNickname":@"user_nick_name",
             @"level":@"level",
             
  
             
             @"status":@"status",
             @"isAllow":@"is_allow",
             
             @"updateTime":@"update_time",
             
             @"avgScore":@"avg_score",
             @"shows":@"shows",
             @"taskRate":@"task_rate"
             };
}

- (NSString *)gradeString {
    NSArray *gradeArray = @[@"一年级",@"二年级",@"三年级",@"四年级",@"五年级",@"六年级",@"七年级",@"八年级",@"九年级"];
    NSInteger gradeIndex = [self.grade integerValue] - 1;
    if (gradeIndex >= 0 && gradeIndex < [gradeArray count]) {
        return gradeArray[gradeIndex];
    }
    
    return nil;
}


+ (NSString *)gradeStringWithGradeIndex:(NSInteger)gradeIndex {
    NSArray *gradeArray = @[@"一年级",@"二年级",@"三年级",@"四年级",@"五年级",@"六年级",@"七年级",@"八年级",@"九年级"];
    if (gradeIndex >= 0 && gradeIndex < [gradeArray count]) {
        return gradeArray[gradeIndex];
    }
    
    return nil;
}

@end
